Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send platform, build channel and country code as part of ad confirmation calls where it meets privacy standards #5067

Merged
merged 1 commit into from
Apr 17, 2020

Conversation

tmancey
Copy link
Collaborator

@tmancey tmancey commented Mar 26, 2020

Resolves brave/brave-browser#8100

Submitter Checklist:

Test Plan:

Use Charles Proxy to capture traffic and confirm the request to the POST /v1/confirmation/{confirmation_id}/{credential} server end-point contains the following in the body:

countryCode i.e. US if the country has large anonymity, see brave/brave-browser#8100 for list of countries (only added for release builds)

platform i.e. macos, windows, linux, android or ios

channelName i.e. release, beta, nightly or dev

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.

Copy link
Collaborator

@kylehickinson kylehickinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iOS lgtm

@tmancey tmancey force-pushed the issues/8100 branch 2 times, most recently from 43327f5 to a2c3ad5 Compare March 26, 2020 16:36
@@ -35,6 +37,80 @@ const uint64_t kDebugNextTokenRedemptionAfterSeconds =
const uint64_t kRetryFailedConfirmationsAfterSeconds =
5 * base::Time::kSecondsPerMinute;

const std::map<std::string, bool> kLargeAnonymityCountryCodes = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the size bound on these and when was it generated? just checking

@diracdeltas
Copy link
Member

it seems that the only new info this adds is the build channel (though isn't that already inferable from the user agent?). we might want to make the country bound larger since when i originally did the analysis, i did not factor in build channel.

@tmancey tmancey force-pushed the issues/8100 branch 2 times, most recently from f68b9a3 to a90f3ea Compare March 31, 2020 12:09
@tmancey
Copy link
Collaborator Author

tmancey commented Mar 31, 2020

it seems that the only new info this adds is the build channel (though isn't that already inferable from the user agent?). we might want to make the country bound larger since when i originally did the analysis, i did not factor in build channel.

I have checked release, beta and nightly builds and unfortunately, the build channel is not available in the user-agent, thanks

@tmancey tmancey requested a review from aekeus April 14, 2020 14:35

return channel_name;
#else // OFFICIAL_BUILD
return "development";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @aekeus @bridiver it seems like before we were returning release for both non official and official builds. It might be good to add a selector for development for stats.

Copy link
Member

@aekeus aekeus Apr 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'developer' channel is available on stats in the database. We would need to add the 'developer' identifier to a few drop down menus. This would not be a large change to make.

Copy link
Member

@aekeus aekeus Apr 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest 'developer' instead of 'development' as that exists on stats already.

  channel  |     description     |      label
-----------+---------------------+------------------
...
developer | Developer channel   | Developer
...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed development developer, thanks

Copy link
Member

@bbondy bbondy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm other than @iefremov 's comments which you have follow up issues for.

@tmancey tmancey force-pushed the issues/8100 branch 6 times, most recently from 757ce20 to a7a49f6 Compare April 15, 2020 09:01
@tmancey tmancey added CI/skip-android Do not run CI builds for Android CI/skip-linux labels Apr 15, 2020
@tmancey
Copy link
Collaborator Author

tmancey commented Apr 15, 2020

macOS and iOS failed CI, restarting

@tmancey tmancey force-pushed the issues/8100 branch 2 times, most recently from d9dc885 to 8d24826 Compare April 17, 2020 08:53
@tmancey tmancey added the CI/skip-ios Do not run CI builds for iOS label Apr 17, 2020
@tmancey
Copy link
Collaborator Author

tmancey commented Apr 17, 2020

CI failed for macOS, restarting macOS

@tmancey
Copy link
Collaborator Author

tmancey commented Apr 17, 2020

Restarting macOS as failed CI

@tmancey
Copy link
Collaborator Author

tmancey commented Apr 17, 2020

Failed due to unrelated rewards browser tests


namespace android_util {

ledger::ClientInfoPtr GetAndroidClientInfo() {
auto info = ledger::ClientInfo::New();
info->platform = ledger::Platform::ANDROID_R;
info->os = ledger::OperatingSystem::UNDEFINED;
info->channel = brave::GetChannelName();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when this is fixed to use chrome::GetChannelName the layering violation here needs to be fixed as well. You cannot use brave/common or chrome/common in components

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @aseren FYI for the refactoring we spoke about

@@ -3273,6 +3274,8 @@ ledger::ClientInfoPtr GetDesktopClientInfo() {
info->os = ledger::OperatingSystem::UNDEFINED;
#endif

info->channel = brave::GetChannelName();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chrome::GetChannelName should be passed to RewardsServiceImpl in the factory to eliminate this layering violation

Copy link
Collaborator Author

@tmancey tmancey Nov 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/skip-android Do not run CI builds for Android CI/skip-ios Do not run CI builds for iOS feature/ads security
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Send platform, build channel, and country as part of ad confirmation calls where it meets privacy standards
10 participants